package example;

import java.util.ArrayList;
import java.util.List;

import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.factory.InstantiationException;
import org.objectweb.fractal.bpc.staticchecker.FrameInstance;

import fr.ema.arch3d.model.architecture.Interface;
import fr.ema.arch3d.model.architecture.specification.ComponentRole;
import fr.ema.arch3d.model.architecture.specification.Connection;
import fr.ema.arch3d.model.architecture.specification.Specification;
import fr.ema.arch3d.model.consistencyChecker.NameConsistencyChecker;
import fr.ema.arch3d.model.consistencyChecker.SpecificationBehaviorConsistencyChecker;

public class clientSever {

    /**
     * Method description
     *
     * @param args
     * @throws NoSuchInterfaceException 
     * @throws InstantiationException 
     */
    public static void main(String[] args) throws InstantiationException, NoSuchInterfaceException {
	Interface cItf=new Interface("cItf", "example.log", true, false,new String[]{"findName"});
	Interface sItf=new Interface("sItf", "example.log", false, false,new String[]{"findName"});
	ComponentRole client=new ComponentRole("client",new Interface[]{cItf},"!cItf.findName*");
	ComponentRole server=new ComponentRole("server",new Interface[]{sItf},"?sItf.findName*");
	Connection cs=new Connection("cs", "cItf", client, "sItf", server);
	Specification spec=new Specification("clientServer");
	
	spec.insertConnection(cs);	
	spec.insertCmpRole(client);
	spec.insertCmpRole(server);
	SpecificationBehaviorConsistencyChecker.check(spec);
	NameConsistencyChecker.check(spec, client);
    }

}
